package components

// Component 组件
type Component interface {
	Process()
}

// Done 完成
type Done struct{}

// Wait 等待组件完成
type Wait chan Done

// Run 运行组件
func Run(c Component) Wait {
	wait := make(Wait)

	go func() {
		c.Process()
		wait <- Done{}
	}()
	return wait
}
